本文整理汇总了C++中setLabelText函数的典型用法代码示例。如果您正苦于以下问题:C++ setLabelText函数的具体用法?C++ setLabelText怎么用?C++ setLabelText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setLabelText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Pin2DialogProc
INT_PTR CALLBACK Pin2DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
static char *pin2;
switch(message) {
case WM_INITDIALOG:
setLabelText(hwnd, IDC_NAME, ((DialogData *)lParam)->name);
if(((DialogData *)lParam)->message != NULL) {
setLabelText(hwnd, IDC_ERROR, ((DialogData *)lParam)->message);
}
pin2 = ((DialogData *)lParam)->pin2;
return true;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
GetDlgItemText(hwnd, IDC_PIN2, pin2, PIN2_MAX_LEN);
case IDCANCEL:
EndDialog(hwnd, LOWORD(wParam));
break;
}
if(HIWORD(wParam) == EN_CHANGE && LOWORD(wParam) == IDC_PIN2) {
Button_Enable(GetDlgItem(hwnd, IDOK), isAcceptableLengthPIN2(hwnd, IDC_PIN2));
}
return true;
case WM_CTLCOLORSTATIC:
if(GetDlgItem(hwnd, IDC_ERROR) == ((HWND)lParam)){
SetTextColor((HDC)wParam, RGB(255, 0, 0));
SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
return (INT_PTR)GetStockObject(NULL_BRUSH);
}
default:
return false;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
示例2: setLabelText
void ofxUIDropDownList::checkAndSetTitleLabel()
{
if(bShowCurrentSelected && selected.size() > 0)
{
string title = "";
int index = 0;
for(vector<ofxUIWidget *>::iterator it = selected.begin(); it != selected.end(); it++)
{
if(index == 0)
{
title+=(*it)->getName();
}
else
{
title+=","+(*it)->getName();
}
index++;
}
if(title.length())
{
setLabelText(title);
}
}
else
{
setLabelText(name);
}
}
示例3: setLabelText
void ScanProgressDialog::setDeviceName(const QString& d)
{
if (d.isEmpty())
setLabelText(i18nc("@label", "Scanning..."));
else
setLabelText(xi18nc("@label", "Scanning device: <filename>%1</filename>", d));
}
示例4: helper
void RecursiveDirJob::run()
{
RecursiveDirJobHelper helper(m_pd != NULL); //report progress info if pd != NULL
connect(&helper, SIGNAL(setValue(quint64)),
this, SLOT(setValue(quint64)), Qt::QueuedConnection);
connect(&helper, SIGNAL(setMaximum(quint64)),
this, SLOT(setMaximum(quint64)), Qt::QueuedConnection);
connect(&helper, SIGNAL(setLabelText(QString)),
this, SLOT(setLabelText(QString)), Qt::QueuedConnection);
qRegisterMetaType<RecursiveDirJob::Error>();
connect(&helper, SIGNAL(errorOccured(RecursiveDirJob::Error)),
this, SLOT(slotErrorOccured(RecursiveDirJob::Error)), Qt::QueuedConnection);
switch( d->m_jobType ) {
case CalculateDirSize:
d->m_result = helper.calculateDirSize(d->m_args[0].toString());
break;
case CpDir:
helper.recursiveCpDir(d->m_args[0].toString(), d->m_args[1].toString(),
d->m_args[2].value<CopyOptions>());
break;
case RmDir:
helper.recursiveRmDir(d->m_args[0].toString());
break;
default:
Q_ASSERT(false);
}
}
示例5: setLabelText
void UpdaterDialog::updateDone(bool result)
{
if (result)
setLabelText(tr("There's a new version available,<br> please see <a href=\"http://lightscreen.sourceforge.net/new-version\">the Lighscreen website</a>."));
else
setLabelText(tr("No new versions available"));
setMaximum(1);
setCancelButtonText(tr("Close"));
}
示例6: setLabelText
void UpdaterDialog::updateDone(bool result)
{
if (result) {
setLabelText(tr("There's a new version available,<br> please see <a href=\"https://lightscreen.com.ar/whatsnew/%1\">the Lighscreen website</a>.").arg(qApp->applicationVersion()));
} else {
setLabelText(tr("No new versions available."));
}
setMaximum(1);
setCancelButtonText(tr("Close"));
}
示例7: setLabelText
void Ui::setDetailedMode(bool mode)
{
detailedMode = mode;
if(detailedMode)
{
setLabelText(controls["Status"], statusStr);
setLabelText(controls["TotalProgressLabel"], msg("Total progress"));
}
else
setLabelText(controls["TotalProgressLabel"], statusStr);
}
示例8: kdDebug
void Kleo::ProgressDialog::slotProgress(const QString &what, int current, int total)
{
kdDebug(5150) << "Kleo::ProgressDialog::slotProgress( \"" << what << "\", "
<< current << ", " << total << " )" << endl;
if(mBaseText.isEmpty())
setLabelText(what);
else if(what.isEmpty())
setLabelText(mBaseText);
else
setLabelText(i18n("%1: %2").arg(mBaseText, what));
setProgress(current, total);
}
示例9: maWidgetSetProperty
/**
* Show the screen.
*/
void HomeScreen::showScreen()
{
// Make the home screen listen for key events.
MAUtil::Environment::getEnvironment().addKeyListener(this);
// Reset the progress bar value to 0, and dismiss it.
maWidgetSetProperty(mProgressLabel,MAW_WIDGET_VISIBLE, "false");
setWidgetProperty(mProgressBar,MAW_PROGRESS_BAR_PROGRESS, 0);
maWidgetSetProperty(mProgressBar,MAW_WIDGET_VISIBLE, "false");
maWidgetSetProperty(mSearchButton, MAW_WIDGET_ENABLED, "true");
// Reset the slider value.
setWidgetProperty(mSlider, MAW_SLIDER_VALUE, 10);
// Clear the edit box.
maWidgetSetProperty(mEditBox, MAW_EDIT_BOX_TEXT, "");
// Check all categories.
for (int i=0; i<mCategoryBoxes.size(); i++)
{
maWidgetSetProperty(mCategoryBoxes[i], MAW_CHECK_BOX_CHECKED, "true");
}
// Initialize the top text label.
setLabelText(mLabel, " ");
// Display this screen.
BasicScreen::showScreen();
}
示例10: QDialog
ProgressSlideshowDialog::ProgressSlideshowDialog(const QStringList &slidesDirectories, const QString &statusMsg, int changeInterval, QWidget *parent) :
QDialog(parent),
_pos(0),
_changeInterval(changeInterval),
_maxSectors(0),
_pausedAt(0),
ui(new Ui::ProgressSlideshowDialog)
{
ui->setupUi(this);
setLabelText(statusMsg);
QRect s = QApplication::desktop()->screenGeometry();
if (s.height() < 400)
setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
else
setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
foreach (QString slidesDirectory, slidesDirectories)
{
QDir dir(slidesDirectory, "*.jpg *.jpeg *.png");
if (dir.exists())
{
QStringList s = dir.entryList();
s.sort();
foreach (QString slide, s)
{
_slides.append(slidesDirectory+"/"+slide);
}
示例11: QMainWindow
AppWindow::AppWindow(QWidget *parent) : QMainWindow(parent),
ui(new Ui::AppWindow)
{
main_all_groups_window = new AllGroups();
group_info_window = new GroupInfo(this);
main_login_window = new LoginWindow(this);
myAppWindow = new AppWindowData();
this->setFixedSize(900, 600);
connect(this, SIGNAL(sendGroupID(QString)), group_info_window, SLOT(setLabelText(QString)));
ui->setupUi(this);
addItemsToCourseNameComboBox();
resetRowCount();
setColumnsOfTable();
main_login_window->show();
QHeaderView* header = ui->listOfAllGroups->horizontalHeader();
header->setSectionResizeMode(QHeaderView::Stretch);
web_interface = HTTPInterface::getInstance();
ui->deleteButton->hide();
ui->userdeleteButton_2->hide();
ui->adminprivButton->hide();
ui->userlistbox->hide();
}
示例12: setLabelText
void Strip::resizeEvent(QResizeEvent* ev)
{
//printf("Strip::resizeEvent\n");
QFrame::resizeEvent(ev);
setLabelText();
setLabelFont();
}
示例13: QWidget
LabeledLineEdit::LabeledLineEdit(String objectName, String label,
String text, bool key) :
QWidget(0),
m_text(text),
m_ui(new Ui::LabeledLineEdit)
{
Logger::getInstance()->debug("LabeledLineEdit::LabeledLineEdit(String objectName, String label, String text, bool key)");
m_ui->setupUi(this);
setLabelText(label);
setText(text);
if (key) {
m_ui->lineEdit->setReadOnly(true);
m_ui->lineEdit->setStyleSheet("QLineEdit{background: pink;}");
}
setObjectName(objectName.c_str());
connect(
m_ui->lineEdit,
SIGNAL(textChanged(QString)),
this,
SLOT(textChanged()));
connect(
m_ui->lineEdit,
SIGNAL(editingFinished()),
this,
SLOT(itemChanged()));
}
示例14: QProgressDialog
DownloadDialog::DownloadDialog(QUrl source, QString destination, QWidget *parent)
: QProgressDialog("Downloading", "Cancel", 0, 100, parent)
, _download(nullptr)
, _completed(false)
{
setMinimumDuration(0);
setWindowTitle("File Download");
_destination.setFileName(destination);
_destination.remove();
if (_destination.open(QIODevice::WriteOnly))
{
QNetworkRequest request(source);
request.setRawHeader("User-Agent", "Mozilla Firefox");
_download = _manager.get(request);
//qDebug() << _download->error();
connect(_download, SIGNAL(downloadProgress(qint64,qint64)),
SLOT(downloadProgress(qint64,qint64)));
connect(_download, SIGNAL(finished()), SLOT(dispose()));
connect(_download, SIGNAL(readyRead()), SLOT(downloadReadyRead()));
connect(this, SIGNAL(canceled()), SLOT(dispose()));
setLabelText("Downloading " + destination);
setValue(0);
}
}
示例15: QDialog
QModernProgressDialog::QModernProgressDialog(const QString & labelText, const QString & cancelButtonText, QWidget* parent, Qt::WindowFlags f):
QDialog(parent, f)
{
createWidgets();
setLabelText(labelText);
setCancelButtonText(cancelButtonText);
}