Changeset 1109
- Timestamp:
- Feb 16, 2019, 6:23:09 PM (6 years ago)
- Location:
- s10k/CommonUtils
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
s10k/CommonUtils/LICENSE
r1095 r1109 1 1 MIT License 2 2 3 Copyright ( c) 2017 random-guy3 Copyright (C) 2017 - 2018 Fábio Bento (fabiobento512) 4 4 5 5 Permission is hereby granted, free of charge, to any person obtaining a copy -
s10k/CommonUtils/README.md
r1095 r1109 1 1 # CommonUtils 2 Common C++ Qt Utils for random-guyprojects2 Common C++ Qt Utils for fabiobento512 projects -
s10k/CommonUtils/util.cpp
r1095 r1109 1 1 /** 2 * Copyright (C) 2017 - Fábio Bento (random-guy)2 * Copyright (C) 2017 - 2018 Fábio Bento (fabiobento512) 3 3 * 4 4 * This library is distributed under the MIT License. See notice at the end … … 266 266 namespace Dialogs { 267 267 268 void showInfo(const QString &message ){268 void showInfo(const QString &message, const bool richText){ 269 269 QMessageBox msgBox; 270 if(richText){ 271 msgBox.setTextFormat(Qt::RichText); 272 } 270 273 msgBox.setIcon(QMessageBox::Information); 271 274 msgBox.setText(message); … … 273 276 } 274 277 275 void show RichInfo(const QString &message){278 void showWarning(const QString &message, const bool richText){ 276 279 QMessageBox msgBox; 277 msgBox.setTextFormat(Qt::RichText); 278 msgBox.setIcon(QMessageBox::Information); 279 msgBox.setText(message); 280 msgBox.exec(); 281 } 282 283 void showWarning(const QString &message){ 284 QMessageBox msgBox; 280 if(richText){ 281 msgBox.setTextFormat(Qt::RichText); 282 } 285 283 msgBox.setIcon(QMessageBox::Warning); 286 284 msgBox.setText(message); … … 288 286 } 289 287 290 void showError(const QString &message ){288 void showError(const QString &message, const bool richText){ 291 289 QMessageBox msgBox; 292 msgBox.setIcon(QMessageBox::Critical); 293 msgBox.setText(message); 294 msgBox.exec(); 295 } 296 297 void showRichError(const QString &message){ 298 QMessageBox msgBox; 290 if(richText){ 291 msgBox.setTextFormat(Qt::RichText); 292 } 299 293 msgBox.setIcon(QMessageBox::Critical); 300 294 msgBox.setText(message); … … 538 532 namespace StatusBar { 539 533 534 void showInfo(QStatusBar * const statusBar, const QString &message){ 535 536 QPalette myPalete = QPalette(); 537 myPalete.setColor( QPalette::WindowText, QColor(0,38,255)); 538 statusBar->setPalette( myPalete ); 539 statusBar->showMessage(message,10000); //display by 10 seconds 540 541 } 542 540 543 void showError(QStatusBar * const statusBar, const QString &message){ 541 544 … … 563 566 564 567 /** 565 * Copyright (c) 2017 - Fábio Bento (random-guy)568 * Copyright (c) 2017 - 2018 Fábio Bento (fabiobento512) 566 569 * 567 570 * Permission is hereby granted, free of charge, to any person -
s10k/CommonUtils/util.h
r1095 r1109 1 1 /** 2 * Copyright (C) 2017 - Fábio Bento (random-guy)2 * Copyright (C) 2017 - 2018 Fábio Bento (fabiobento512) 3 3 * 4 4 * This library is distributed under the MIT License. See notice at the end … … 96 96 namespace Dialogs { 97 97 98 void showInfo(const QString &message );98 void showInfo(const QString &message, const bool richText = false); 99 99 100 void show RichInfo(const QString &message);100 void showWarning(const QString &message, const bool richText = false); 101 101 102 void showWarning(const QString &message); 103 104 void showError(const QString &message); 105 106 void showRichError(const QString &message); 102 void showError(const QString &message, const bool richText = false); 107 103 108 104 bool showQuestion(QWidget * parent, QString message, QMessageBox::StandardButton standardButton=QMessageBox::NoButton); … … 151 147 namespace StatusBar { 152 148 149 void showInfo(QStatusBar * const statusBar, const QString &message); 153 150 void showError(QStatusBar * const statusBar, const QString &message); 154 151 void showSuccess(QStatusBar * const statusBar,const QString &message); … … 162 159 163 160 /** 164 * Copyright (c) 2017 - Fábio Bento (random-guy)161 * Copyright (c) 2017 - 2018 Fábio Bento (fabiobento512) 165 162 * 166 163 * Permission is hereby granted, free of charge, to any person
Note:
See TracChangeset
for help on using the changeset viewer.